function! trainer#python#init_python() abort
    if exists('g:loaded_trainer_python') 
        finish
    endif

    let g:loaded_trainer_python = 1
    python3 << EOF
import sys
import os
import vim

plugin_path = vim.eval('expand("<sfile>:p:h:h")')

# 将 pythonx 目录添加到 Python 模块搜索路径
pythonx_path = os.path.join(plugin_path, 'pythonx')
if pythonx_path not in sys.path:
    sys.path.insert(0, pythonx_path)

import trainer.manager as tm
EOF
endfunction
